

import AsyncComponent from '../utils/AsyncComponent/index'
// import Login from '@/views/Login/index'
// import HomeIndex from '@/views/HomeIndex/index';
// 一级路由
const Login = AsyncComponent(() => import('../views/Login/index'))
const HomeIndex = AsyncComponent(() => import('../views/HomeIndex/index'))

const Center = AsyncComponent(() => import('../views/HomeIndex/pages/center'))
const Student = AsyncComponent(() => import('../views/HomeIndex/pages/student'))
const Teacher = AsyncComponent(() => import('../views/HomeIndex/pages/teacher'))
const Grade = AsyncComponent(() => import('../views/HomeIndex/pages/grade'))

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/homeIndex',
    component: HomeIndex,
    children: [
      {
        path: '/homeIndex',
        redirect: '/homeIndex/teacher'
      },
      {
        path: '/homeIndex/teacher',
        component: Teacher
      },
      {
        path: '/homeIndex/student',
        component: Student
      },
      {
        path: '/homeIndex/Center',
        component: Center
      },
      {
        path: '/homeIndex/grade',
        component: Grade
      }
    ]
  }
]

export default routes;